New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@perfective/error

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@perfective/error

Functions for the Error and other types to handle exceptions

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Error

The @perfective/error package provides functions for the Error class and other error types.

  • throws<E extends Error>(error?: E | string): never — throws a provided error.
  • panic<E extends Error>(error?: E | string): () => never — creates a function that throws a provided error.
  • Error:
    • error(message?: string): Error — instantiates a new Error.
    • isError<T>(value: Error | T): value is Error — returns true when the value is an instance of Error.
    • isNotError<T>(value: Error | T): value is T — returns true when the value is not an instance of Error.
  • EvalError:
    • evalError(message?: string): EvalError — instantiates a new EvalError.
    • isEvalError<T>(value: EvalError | T): value is EvalError — returns true when the value is an instance of EvalError.
    • isNotEvalError<T>(value: EvalError | T): value is T — returns true when the value is not an instance of EvalError.
  • RangeError:
    • rangeError(message?: string): RangeError — instantiates a new RangeError.
    • isRangeError<T>(value: RangeError | T): value is RangeError — returns true when the value is an instance of RangeError.
    • isNotRangeError<T>(value: RangeError | T): value is T — returns true when the value is not an instance of RangeError.
  • ReferenceError:
    • referenceError(message?: string): ReferenceError — instantiates a new ReferenceError.
    • isReferenceError<T>(value: ReferenceError | T): value is ReferenceError — returns true when the value is an instance of ReferenceError.
    • isNotReferenceError<T>(value: ReferenceError | T): value is T — returns true when the value is not an instance of ReferenceError.
  • SyntaxError:
    • syntaxError(message?: string): SyntaxError — instantiates a new SyntaxError.
    • isSyntaxError<T>(value: SyntaxError | T): value is SyntaxError — returns true when the value is an instance of SyntaxError.
    • isNotSyntaxError<T>(value: SyntaxError | T): value is T — returns true when the value is not an instance of SyntaxError.
  • TypeError:
    • typeError(message?: string): TypeError — instantiates a new TypeError.
    • isTypeError<T>(value: TypeError | T): value is TypeError — returns true when the value is an instance of TypeError.
    • isNotTypeError<T>(value: TypeError | T): value is T — returns true when the value is not an instance of TypeError.

Read the full documentation in the repository.

FAQs

Package last updated on 05 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc